import java.awt.*;
import java.awt.event.*;

public class FlowLayoutEX extends Frame implements ActionListener
{
 int i;
    Button bok1 = new Button("按键");
    Button bok2 = new Button("OK");

    FlowLayoutEX()
    {
        this.setTitle(" FlowLayoutEx ");
        this.setLayout(new FlowLayout());
        
        this.add(bok1);
        bok1.addActionListener(this);
        this.add(bok2);
         this.setBackground(Color.red);
        this.setResizable(false);
        this.setAlwaysOnTop(true);
        this.setBounds(100,100,250,250);
        this.setVisible(true);
        }
    
    public void actionPerformed(ActionEvent e)
     {
     i++;
     Button bi = new Button("按钮");
     this.add(bi);
     this.show(true);
    }
    public static void main(String[] args)
    {
        //System.out.println("Hello World!");
         new  FlowLayoutEx();       
    }
}
